<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>消息</title>
		<!--#include file="/pub-page/sd_load_js.html" -->
		<!--#include file="/pub-page/sd_load_css.html" -->
	</head>
	<body>
		<div class="container-fluid">
			<div class="row mgb-20">
				<div class="col-sm-4">
				</div>
				<div class="col-sm-8">
				<input type="text" class="form-control" id="title" placeholder="输入消息的标题"/>
				</div>
			</div>
			<div class="row text-info">
				内容：<textarea id="content" rows="10" cols="40"></textarea>
			</div>
			<div class="row mgt-10">
				<div class="col-xs-4 col-xs-offset-4">
					<button class="btn btn-primary form-control" onclick="submiteAdd();">确定</button>
				</div>
			</div>			
		</div>
	</body>
	<script>
		var pageLayer;
		layui.use('layer', function(){
			pageLayer = layui.layer;
		});
		function submiteAdd(){
			var url = "/sd_baseData/notice/publishNotice";
			var params = {};
			params.title = $("#title").val();
			params.content = $("#content").val();
			require(['ajaxUtil'], function(ajaxUtil){
				ajaxUtil.doPost(url, function(data){
					if(data.code == 0){
						pageLayer.alert(data.message, {
							icon: 6,
							end:function(){
								window.parent.pageLayer.closeAll();
							}
						});
					}else{
						pageLayer.alert(data.message, {
							icon: 5,
							end: function(){
								window.parent.pageLayer.closeAll();
							}
						});
					}
				},params);
			});			
		}
	</script>
</html>